var d_2={
		name:"一般公共预算收入",
		area:"全市及县市区",
		suffix:"亿元",
		data:[
			{area:"全市",total:189.0,totalrank:0,growth:15.7,growthrank:0},
			{area:"崇川区",total:25.4,totalrank:1,growth:21.6,growthrank:3},
			{area:"港闸区",total:12.5,totalrank:9,growth:30.5,growthrank:1},
			{area:"开发区",total:13.4,totalrank:8,growth:11.3,growthrank:9},
			{area:"通州区",total:24.1,totalrank:2,growth:13.7,growthrank:6},
			{area:"海安县",total:20.7,totalrank:6,growth:15.2,growthrank:4},
			{area:"如东县",total:17.7,totalrank:7,growth:21.9,growthrank:2},
			{area:"启东市",total:22.9,totalrank:5,growth:13.7,growthrank:6},
			{area:"如皋市",total:23.6,totalrank:3,growth:13.2,growthrank:8},
			{area:"海门市",total:23.6,totalrank:3,growth:15.1,growthrank:5}
		]
	};

var d_1={
	name:"规模以上工业增加值",
	area:"全市及县市区",
	suffix:"亿元",
	data:[
		{area:"全市",total:858.2,totalrank:0,growth:10.7,growthrank:0},
		{area:"崇川区",total:23.2,totalrank:9,growth:2.9,growthrank:9},
		{area:"港闸区",total:32.3,totalrank:8,growth:9.9,growthrank:8},
		{area:"开发区",total:117.6,totalrank:3,growth:10.4,growthrank:7},
		{area:"通州区",total:132.8,totalrank:1,growth:11.2,growthrank:2},
		{area:"海安县",total:126.1,totalrank:2,growth:11.1,growthrank:3},
		{area:"如东县",total:116.3,totalrank:4,growth:11.4,growthrank:1},
		{area:"启东市",total:109.4,totalrank:6,growth:10.9,growthrank:5},
		{area:"如皋市",total:95.7,totalrank:7,growth:11.0,growthrank:4},
		{area:"海门市",total:116.2,totalrank:5,growth:10.9,growthrank:5}
	]
};

var d_3={
	name:"工业应税销售收入",
	area:"全市及县市区",
	suffix:"亿元",
	data:[
		{area:"全市",total:1948.0,totalrank:0,growth:2.4,growthrank:0},
		{area:"崇川区",total:129.7,totalrank:9,growth:-12.0,growthrank:9},
		{area:"港闸区",total:150.0,totalrank:8,growth:5.5,growthrank:3},
		{area:"开发区",total:239.0,totalrank:3,growth:2.9,growthrank:4},
		{area:"通州区",total:254.9,totalrank:2,growth:1.5,growthrank:5},
		{area:"海安县",total:286.0,totalrank:1,growth:6.3,growthrank:2},
		{area:"如东县",total:238.0,totalrank:4,growth:14.0,growthrank:1},
		{area:"启东市",total:182.9,totalrank:7,growth:1.1,growthrank:6},
		{area:"如皋市",total:211.6,totalrank:5,growth:-0.8,growthrank:8},
		{area:"海门市",total:191.8,totalrank:6,growth:-0.5,growthrank:7}
	]
};

var d_4={
	name:"工业用电量",
	area:"全市及县市区",
	suffix:"亿千瓦时",
	data:[
		{area:"全市",total:76.8,totalrank:0,growth:5.3,growthrank:0},
		{area:"崇川区",total:4.2,totalrank:8,growth:-1.5,growthrank:7},
		{area:"港闸区",total:3.4,totalrank:9,growth:-4.2,growthrank:9},
		{area:"开发区",total:11.7,totalrank:1,growth:6.3,growthrank:3},
		{area:"通州区",total:11.7,totalrank:1,growth:11.3,growthrank:1},
		{area:"海安县",total:10.3,totalrank:3,growth:-2.6,growthrank:8},
		{area:"如东县",total:10.2,totalrank:4,growth:10.5,growthrank:2},
		{area:"启东市",total:5.3,totalrank:7,growth:5.1,growthrank:4},
		{area:"如皋市",total:9.9,totalrank:5,growth:1.5,growthrank:6},
		{area:"海门市",total:7.6,totalrank:6,growth:2.7,growthrank:5}
	]
};

var d_5={
	name:"固定资产投资	",
	area:"全市及县市区",
	suffix:"亿元",
	data:[
		{area:"全市",total:1431.0,totalrank:0,growth:14.3,growthrank:0},
		{area:"崇川区",total:96.4,totalrank:8,growth:-22.8,growthrank:9},
		{area:"港闸区",total:86.4,totalrank:9,growth:34.6,growthrank:1},
		{area:"开发区",total:149.6,totalrank:7,growth:15.4,growthrank:6},
		{area:"通州区",total:209.8,totalrank:1,growth:14.1,growthrank:7},
		{area:"海安县",total:177.3,totalrank:3,growth:20.0,growthrank:2},
		{area:"如东县",total:173.1,totalrank:5,growth:11.8,growthrank:8},
		{area:"启东市",total:176.4,totalrank:4,growth:19.6,growthrank:3},
		{area:"如皋市",total:172.2,totalrank:6,growth:18.6,growthrank:5},
		{area:"海门市",total:180.7,totalrank:2,growth:19.6,growthrank:3}
	]
};

var d_6={
	name:"社会消费品零售总额",
	area:"全市及县市区",
	suffix:"亿元",
	data:[
		{area:"全市",total:769.8,totalrank:0,growth:9.5,growthrank:0},
		{area:"崇川区",total:117.5,totalrank:1,growth:8.1,growthrank:8},
		{area:"港闸区",total:39.9,totalrank:9,growth:10.0,growthrank:4},
		{area:"开发区",total:45.6,totalrank:8,growth:7.9,growthrank:9},
		{area:"通州区",total:98.3,totalrank:4,growth:8.2,growthrank:7},
		{area:"海安县",total:80.5,totalrank:7,growth:11.8,growthrank:1},
		{area:"如东县",total:93.4,totalrank:6,growth:11.6,growthrank:2},
		{area:"启东市",total:94.3,totalrank:5,growth:9.1,growthrank:5},
		{area:"如皋市",total:100.4,totalrank:2,growth:10.2,growthrank:3},
		{area:"海门市",total:100.0,totalrank:3,growth:9.1,growthrank:5}
	]
};

var d_7={
	name:"进出口总额",
	area:"全市及县市区",
	suffix:"亿美元",
	data:[
		{area:"全市",total:104.2,totalrank:0,growth:4.2,growthrank:0},
		{area:"崇川区",total:23.8,totalrank:1,growth:14.1,growthrank:6},
		{area:"港闸区",total:9.8,totalrank:6,growth:28.9,growthrank:2},
		{area:"开发区",total:15.7,totalrank:2,growth:-1.6,growthrank:7},
		{area:"通州区",total:10.9,totalrank:3,growth:16.6,growthrank:4},
		{area:"海安县",total:5.1,totalrank:9,growth:-31.3,growthrank:8},
		{area:"如东县",total:9.2,totalrank:7,growth:-37.6,growthrank:9},
		{area:"启东市",total:10.7,totalrank:5,growth:18.8,growthrank:3},
		{area:"如皋市",total:10.9,totalrank:3,growth:15.8,growthrank:5},
		{area:"海门市",total:8.0,totalrank:8,growth:44.3,growthrank:1}
	]
};

var d_8={
	name:"出口总额",
	area:"全市及县市区",
	suffix:"亿美元",
	data:[
		{area:"全市",total:74.1,totalrank:0,growth:11.7,growthrank:0},
		{area:"崇川区",total:17.2,totalrank:1,growth:20.8,growthrank:3},
		{area:"港闸区",total:7.9,totalrank:6,growth:34.8,growthrank:1},
		{area:"开发区",total:9.3,totalrank:3,growth:-0.7,growthrank:8},
		{area:"通州区",total:9.6,totalrank:2,growth:15.8,growthrank:5},
		{area:"海安县",total:4.3,totalrank:8,growth:-33.6,growthrank:9},
		{area:"如东县",total:4.0,totalrank:9,growth:2.2,growthrank:7},
		{area:"启东市",total:8.0,totalrank:5,growth:16.3,growthrank:4},
		{area:"如皋市",total:9.3,totalrank:3,growth:34.0,growthrank:2},
		{area:"海门市",total:4.5,totalrank:7,growth:2.8,growthrank:6}
	]
};

var keymap={
	"南通市":0,
	"崇川区":1,
	"港闸区":2,
	"开发区":3,
	"通州区":4,
	"海安县":5,
	"如东县":6,
	"启东市":7,
	"如皋市":8,
	"海门市":9
};

var datajson=[];
datajson.push(d_1);
datajson.push(d_2);
datajson.push(d_3);
datajson.push(d_4);
datajson.push(d_5);
datajson.push(d_6);
datajson.push(d_7);
datajson.push(d_8);



/**
 * [getMaxAndMin 获取最大值和最小值]
 * @param  {[type]} data [数据数组]
 * @return {[type]}      [返回最大和最小的近似值]
 */
function getMaxAndMin(data){
    var max,min;
    for(m in data){
      	var d = data[m].value;
        if(isNaN(parseInt(d))==true) continue;
        min = min == undefined ? d : min;
        max = max == undefined ? d : max;
        min = min > d ? d : min;
        max = max < d ? d : max;
    }
    min = getTen(min,false);
    max = getTen(max,true);
    count=max-min;
    //count>100?count/20:count/10
    return [max, min, 5]
}

function getTen(m,b){
  var num=m
  if(b==true){
    num=num<10?10:num;
    if(num==10) return num;
    num=Math.floor(num);
    //取最大整数
    var nums=num+'',numsl=nums.length;
    nums=nums.substr(0,1);
    num=(parseInt(nums)+2)*Math.pow(10, numsl - 1);
  }else{
    var zero=num<0?true:false;
    num=Math.floor(num);
    var nums=Math.abs(num)+'',numsl=nums.length;
    if(numsl<2){
      if(zero==true){
        return -10;
      }else{
        return 0;
      }
    }
    //取最小整数
    nums=nums.substr(0,1);
    num=(parseInt(nums)+(zero==true?1:-1))*Math.pow(10, numsl - 1)*(zero==true?-1:1);
  }
  return num;
}